home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Prog / H-K / Icon.sample.cpt / diffwords.icn < prev    next >
Text File  |  1988-04-07  |  358b  |  16 lines

  1. #
  2. #          D I F F E R E N T   W O R D S
  3. #
  4.  
  5. #  This program lists all the different words in the input text.
  6. #  The definition of a "word" is naive.
  7.  
  8. procedure main()
  9.    letter := &lcase ++ &ucase
  10.    words := set()
  11.    while text := read() do
  12.       text ? while tab(upto(letter)) do
  13.          insert(words,tab(many(letter)))
  14.    every write(!sort(words))
  15. end
  16.